<div class="layui-fluid layui-anim website-anim-up" id="website-home" lay-title="系统首页">
    <div class="layui-row layui-col-space8 website-container">
        <div class="layui-col-md10 layui-col-sm10 layui-col-xs10">
            <div class="layui-card" id="client-user-info">
                <div class="layui-card-header"><i class="layui-icon layui-icon-friends"></i>&nbsp;基本信息</div>
                <div class="layui-card-body">

                    <!-- 基本信息-->
                    <div class="layui-row">
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">姓名：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.name :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">民族：</div>
                            <div id="nationTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9"></div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">手机：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.mobile :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">性别：</div>
                            <div id="sexTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">工作单位：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.company :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">职务：</div>
                            <div id="positionTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">座机：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.telephone :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">政治面貌：</div>
                            <div id="politicalTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">通讯地址：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.address :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">职称级别：</div>
                            <div id="titleTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">职称：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.professionCode :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">最终学位：</div>
                            <div id="degreeTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">证件号：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.identity :''}]]
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">外语语种：</div>
                            <div id="language" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">担任导师：</div>
                            <div id="tutorTypeCode" class="layui-col-xs8 layui-col-sm8 layui-col-md9">
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                            <div class="layui-col-xs4 layui-col-sm4 layui-col-md3">邮箱：</div>
                            <div class="layui-col-xs8 layui-col-sm8 layui-col-md9"> [[${applicantInfo != null ?
                                applicantInfo.email :''}]]
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-xs12 layui-col-sm12 layui-col-md5 layui-col-md-offset7">
                            <div class="info-option">
                                <button id="updateApplicantInfo" class="layui-btn layui-btn-normal layui-btn-sm">修改基本信息
                                </button>
                                <button id="updateApplicantMobile" class="layui-btn layui-btn-normal layui-btn-sm">修改邮箱号
                                </button>
                                <button id="updateApplicantPassword" class="layui-btn layui-btn-normal layui-btn-sm">
                                    修改登录密码
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-card" id="client-class-apply">
                <div class="layui-card-header"><i class="layui-icon layui-icon-tabs"></i>&nbsp;年度课题申报</div>
                <div class="layui-card-body website-table-full">
                    <form class="layui-form layui-table-form" lay-filter="class-apply-table-form"
                          id="class-apply-table-form">
                        <div class="layui-row">
                            <div class="layui-col-md10">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label ">课题名称</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="name" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">学科分类</label>
                                        <div class="layui-input-inline">
                                            <select name="subjectTypeCode" lay-filter="subjectTypeCode">
                                                <option value="">请选择</option>
                                                <option
                                                        th:each="item : ${subjectTypeCode}"
                                                        th:value="${item.code}" th:text="${item.name}">
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label ">审核状态</label>
                                        <div class="layui-input-inline">
                                            <select name="statusTypeCode" lay-filter="statusTypeCode">
                                                <option value="">请选择</option>
                                                <option
                                                        th:each="item : ${topicStatusCode}"
                                                        th:value="${item.code}" th:text="${item.name}">
                                                </option>
                                            </select>
                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
                                <div class="layui-btn layui-btn-sm layui-btn-primary website-button-blue-plain table-action"
                                     id="query">
                                    查询
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary website-button-green-plain table-action"
                                     id="reset">
                                    重置
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary table-action action-add-apply">
                                    新增
                                </div>
                            </div>
                        </div>
                    </form>
                    <table lay-filter="classApplyTable" lay-data="{id: 'classApplyTable'}"></table>
                </div>
            </div>
            <div class="layui-card" id="client-class-entrust">
                <div class="layui-card-header"><i class="layui-icon layui-icon-tabs"></i>&nbsp;委托课题</div>
                <div class="layui-card-body website-table-full">
                    <form class="layui-form layui-table-form" id="declareEntrust-table-form"
                          lay-filter="declareEntrust-table-form">
                        <div class="layui-row">
                            <div class="layui-col-md10">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">课题名称</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="name" autocomplete="off" class="layui-input"
                                                   placeholder="请输入课题名称">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">选题名称</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="topicName" autocomplete="off" class="layui-input"
                                                   placeholder="请输入课题名称">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">主持人</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="leaderName" autocomplete="off" class="layui-input"
                                                   placeholder="请输入主持人">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
                                <div class="layui-btn layui-btn-sm layui-btn-primary website-button-blue-plain table-action"
                                     id="query-entrust">
                                    查询
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary website-button-green-plain table-action"
                                     id="reset-entrust">
                                    重置
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary table-action"
                                     id="action-add-entrust">
                                    新增
                                </div>
                            </div>
                        </div>
                    </form>
                    <table lay-filter="declareEntrustTable" lay-data="{id: 'declareEntrustTable'}"></table>
                </div>
            </div>
            <div class="layui-card" id="client-class-solicit">
                <div class="layui-card-header"><i class="layui-icon layui-icon-file"></i>&nbsp;选题征集</div>
                <div class="layui-card-body">
                    <div class="layui-row">
                        <form class="layui-form layui-table-form" lay-filter="class-solicit-table-form"
                              id="class-solicit-table-form">
                            <div class="layui-col-md10">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">征集公告名称</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="noticeName" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">建议课题名称</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="topicName" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">建议人</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="userName" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">

                                <div class="layui-btn layui-btn-sm layui-btn-primary website-button-blue-plain table-action"
                                     id="query-solicit">
                                    查询
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary website-button-green-plain table-action"
                                     id="reset-solicit">
                                    重置
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary table-action action-add-solicit">
                                    新增
                                </div>
                            </div>
                        </form>
                    </div>
                    <table lay-filter="classSolicitTable" lay-data="{id: 'classSolicitTable'}"></table>
                </div>
            </div>

        </div>
    </div>
</div>


<!--申报人表操作栏 1 无意向申请 有意向申报状态下的未申报只有意向申请按钮-->
<script type="text/html" id="apply-option">
    {{#
    let businessType = d.businessType,
    status = d.statusTypeCode;
    let btnText ;
    if( (status === 'no_apply' && businessType ==='1' && d.declareId) || (businessType ==='0' &&  status === 'pre_apply')){
    btnText = '课题申请'
    }else{
    btnText = '修改'
    }
    }}
    <a lay-event="detail" class="website-green">查看</a>

    {{#

    if( (businessType ==='0' && (status === 'pre_apply' || status === 'no_apply'))|| (businessType ==='1' && status === 'no_apply')){}}
    <a lay-event="edit" class="website-blue">
        {{ btnText}}
    </a>
    {{#  } }}

    {{# if( (businessType ==='0' ||  businessType ==='1' )&& status === 'no_apply' ){}}
    <a lay-event="del" class="website-red">删除</a>
    {{#  } }}

    {{# if( businessType ==='0'&& status === 'no_apply' ){}}
    <a lay-event="submit" class="website-orange">意向申请</a>
    {{#  } }}

    <!-- {{# if( status === 'pre_apply' || (businessType ==='1' && status === 'no_apply' ) ){}}
     <a lay-event="classApply" class="website-orange">课题申请</a>
     {{#  } }}-->

    {{# if( status === 'pre_item' && d.isPreItemNotice){ }}
    <a lay-event="preItem" class="website-orange">拟立项申请</a>
    {{#  } }}

    {{# if( (status === 'check_failed' || status === 'check_passed' || status === 'pre_item' || status === 'item_no_check' ||
    status === 'item_check_passed' || status === 'item_check_failed' || status === 'item_passed' || status === 'item_failed'
    ||status ==='check_passed_review')&& d.isPreItemNotice
    ){ }}
    <a lay-event="appraisalResult" class="website-green">评审结果</a>
    {{#  } }}

    {{# if( status === 'item_passed'){}}
    <a lay-event="appropriationRecords" class="website-green">经费记录</a>
    {{#  } }}

</script>
<!--课题表操作栏-->
<script type="text/html" id="solicit-option">
    <a lay-event="detail" class="website-green">查看</a>
    {{#  if(!d.isSubmit){ }}
    <a lay-event="edit" class="website-blue">修改</a>
    <a lay-event="del" class="website-red">删除</a>
    <a lay-event="submit" class="website-blue">提交</a>
    {{#  } }}
</script>
<!--委托课题-->
<script type="text/html" id="declareEntrust-option">

    <a lay-event="detail" class="website-green">查看</a>

    {{# if(d.examine =='info_no' || d.examine =='info_failed'){}}
    <a lay-event="edit" class="website-blue">编辑</a>
    <a lay-event="delete" class="website-red">删除</a>
    <a lay-event="submit" class="website-blue">提交</a>
    {{#  }  }}


    <!--   判断是否有延期申请，没有延期申请就判断是否已过拟结项日期，如果有延期申请，判断是否过延期时间  -->
    {{#
    if(
    (d.examine ==='info_passed' || (d.examine =='conclude_failed' && d.isPreItemNotice) )
    && d.examineDelay != 'delay_wait'
    && d.statusTypeCode !=='conclude_passed'
    && d.statusTypeCode !=='conclude_apply'
    && d.applyCount < 2){ }}
    <a lay-event="postponeApply" class="website-red">延期申请</a>
    {{#  } }}
    {{# if( (d.examine ==='info_passed' || (d.examine =='conclude_failed' && d.isPreItemNotice) )
    && d.examineChange != 'change_wait'
    && d.statusTypeCode !=='conclude_passed'
    && d.statusTypeCode !=='conclude_apply'
    && d.applyCount < 2 ){}}
    <a lay-event="changeApply" class="website-orange">变更申请</a>
    {{#  } }}
    <!--    1. 判断为通过审核，或者结项不通过也可以再次提交
    2. 已提交申报的不能再重复提交
    3. 结项通过的不能再重复提交
    4. 申请次数小于两次
    5. 结项时间或者延期时间小于当前时间
    -->
    {{#
    let estimateTime = new Date( new Date(d.estimateTime).getTime() +24*60*60*1000-1);
    let termTime = new Date( new Date(d.term).getTime() +24*60*60*1000-1);;
    let currentTime = new Date().getTime();
    if(

    (d.examine ==='info_passed' || (d.examine =='conclude_failed' && d.isPreItemNotice) )
    && d.statusTypeCode !=='conclude_apply'
    && d.statusTypeCode !=='conclude_passed'
    && d.applyCount < 2
    && (estimateTime >=   currentTime|| (termTime  >= currentTime && d.examineDelay ==='delay_passed'))

    ){

    }}
    <!--   基于 info_passed 未申报、结项不通过 并且次数不超过 2 次 延期申请时间，拟结项时间-->
    <a lay-event="endApply" class="website-green">结项申请</a>
    {{#    } }}
    <!---->
    {{# if((d.examine ==='info_passed' || d.examine === 'conclude_failed' || d.examine === 'check_passed_review'
    || d.examine === 'conclude_apply' || d.examine === 'conclude_passed' ||  d.examine === 'conclude_assign')){}}
    <a lay-event="appropriationRecords" class="website-green">经费记录</a>
    {{#  } }}
    <!--    -->
    {{# if((d.concludeCode === 'review' || d.concludeCode === 'plan_conclude_finish' ) && d.isPreItemNotice){}}
    <a lay-event="appraisalResult" class="website-green">评审结果</a>
    {{#  } }}
</script>

<!--字典表查询-->
<script type="text/html" id="leader-name-type">
    {{#  if(d.leader){ }}
    <span>{{ d.leader.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="company-name-type">
    {{#  if(d.leader){ }}
    <span>{{ d.leader.company }}</span>
    {{#  } }}
</script>
<script type="text/html" id="subject-name-type">
    {{#
    let dictSubjectTypeCode=layui.dict.getByCode(d.subjectTypeCode);
    }}
    {{#  if(dictSubjectTypeCode){ }}
    <span>{{ dictSubjectTypeCode.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="research-name-type">
    {{#
    let dict=layui.dict.getByCode(d.researchTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="achievement-form-name-type">
    {{#
    let dictList=layui.dict.getByCodes(d.achievementFormTypeCode ? d.achievementFormTypeCode.split(','): '');
    }}
    <span>
    {{# layui.each(dictList,function(index,item) { }}
    {{ item.name }}&nbsp;
    {{#  }); }}
    </span>
</script>
<script type="text/html" id="status-name-type">
    {{#
    let dict=layui.dict.getByCode(d.statusTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="position-type">
    {{#
    let dict=layui.dict.getByCode(d.position);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="title-type">
    {{#
    let dict=layui.dict.getByCode(d.academic);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="subject-name-type-codes">
    {{#
    let dictList=layui.dict.getByCodes(d.subjectTypeCodes);
    }}
    <span>
    {{# layui.each(dictList,function(index,item) { }}
    {{ item.name }}&nbsp;
    {{#  }); }}
    </span>
</script>
<script type="text/html" id="examineType">
    {{#
    let dict=layui.dict.getByCode(d.processCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>


<script data-th-inline="javascript" type="text/javascript">
    layui.use(['clientModules', 'jquery', 'laydate', 'form', 'table', 'website', 'dict', 'upload', 'formSelects', 'validate'], function () {
        let $ = layui.jquery,
            laydate = layui.laydate,
            website = layui.website,
            form = layui.form,
            formSelects = layui.formSelects,
            table = layui.table,
            client = layui.clientModules,
            upload = layui.upload,
            validate = layui.validate,

            $view = $('#website-home'),
            $applyView = $('#client-class-apply'),
            $solicitView = $('#client-class-solicit'),
            $entrustView = $('#client-class-entrust'),

            $addApply = $('.action-add-apply'),
            $addSolicit = $('.action-add-solicit'),
            $addEntrust = $entrustView.find('#action-add-entrust'),

            $updateApplicantInfo = $('#updateApplicantInfo'),
            $updateApplicantPassword = $('#updateApplicantPassword'),
            $updateApplicantMobile = $('#updateApplicantMobile'),

            $query = $applyView.find('#query'),
            $querySolicit = $solicitView.find('#query-solicit'),
            $queryEntrust = $entrustView.find('#query-entrust'),

            $resetApply = $applyView.find('#reset'),
            $resetEntrust = $entrustView.find('#reset-entrust'),
            $resetSolicit = $solicitView.find('#reset-solicit'),

            $solicitForm = $solicitView.find('#class-solicit-table-form'),
            $entrustForm = $entrustView.find('#declareEntrust-table-form'),
            $applyForm = $applyView.find('#class-apply-table-form'),

            sortObject = {field: 'createTime', type: null},
            sortSolicitObject = {field: 'isSubmit', type: 'desc'},


            applicantInfo = [[${applicantInfo}]],
            achievementForm = [[${achievementForm}]],

            uploadFile,
            postponeApplyUploadFile,
            uploadFileAnonymous,
            uploadFileAnonymousEnd,
            uploadFileEnd,
            uploadFileEndApply,

            tableApplyIns,
            tableSolicitIns,
            tableEntrustIns;
        // 重新渲染 form否则不会显示下拉框
        form.render();

        form.verify(validate);
        initApplicantInfo();
        initEntrustTable();
        // 渲染表格
        initApplyTable();
        initSolicitTable();

        $resetApply.on('click', function () {

            $applyForm[0].reset();
            tableApplyIns.reload({where: getApplyQueryParams(), page: {curr: 1}, initSort: sortObject});
        });

        $resetSolicit.on('click', function () {
            $solicitForm[0].reset();
            tableSolicitIns.reload({where: getSolicitQueryParams(), page: {curr: 1}, initSort: sortObject});
        });

        $resetEntrust.on('click', function () {
            $entrustForm[0].reset();
            tableEntrustIns.reload({where: getEntrustQueryParams(), page: {curr: 1}, initSort: sortObject});
        });

        function initApplyTable() {
            tableApplyIns = website.table.init({
                elem: $applyView.find('table'),
                id: 'classApplyTable',
                url: ctx + 'declareTopic/list',
                where: {
                    topicClassifyCode: 'annual'
                },
                cols: [
                    [
                        {field: 'code', title: '课题编号', minWidth: 80},
                        {field: 'name', title: '课题名称', minWidth: 150},
                        {field: 'topicCode', title: '指南序号'},
                        {templet: '#subject-name-type', title: '学科分类'},
                        {templet: '#research-name-type', title: '研究类型'},
                        {templet: '#achievement-form-name-type', title: '成果形式'},
                        {templet: '#status-name-type', title: '审核状态'},
                        {title: '操作', minWidth: 300, toolbar: '#apply-option',}
                    ]
                ]
            });
        }

        table.on('tool(classApplyTable)', function (obj) {
            let data = obj.data,
                layEvent = obj.event;
            if (layEvent === 'detail') {
                // 查看详情
                website.navigate("/client/classApplyDetail/" + data.declareId)
            }
            if (layEvent === 'del') {
                website.modal.confirm('删除信息', '确定删除该信息？', function () {
                    deleteApply(data.declareId);
                });
            }
            if (layEvent === 'edit') {
                // 修改
                website.navigate("/client/updateClassApply/" + data.declareId + '/' + data.year)
            }

            if (layEvent === 'appraisalResult') {
                // 查看评审结果
                website.navigate("/client/classAppraisalResult/" + data.declareId + "/" + data.planId)
            }
            if (layEvent === 'appropriationRecords') {
                // 查看经费拨付记录

                website.modal.open('经费拨付记录', 'client/classAppropriationRecords/' + data.declareId, {
                    btn: ['返回'],
                    area: $(window).width() <= 750 ? '95%' : '50%',
                    offset: '30px',
                    yes: function (index, layero) {
                        layer.closeAll();
                    }
                });
            }
            if (layEvent === 'submit') {
                client.checkSubmit(function () {
                    // 申请详情
                    website.post(ctx + 'declareTopic/' + data.declareId + '/preCommit', null, function (data) {
                        website.alert.success('意向提交成功');
                        $query.click();
                    });
                });
            }

            if (layEvent === 'classApply') {
                classApplyOpen(data.declareId)
            }

            if (layEvent === 'preItem') {
                preItemApply(data.declareId)
            }
        });

        function getApplyQueryParams() {
            let params = $applyForm.serializeJson();
            return params;
        }

        $query.on('click', function () {
            let params = $.extend(getApplyQueryParams(), {field: sortObject.field, order: sortObject.type});
            tableApplyIns.reload({where: params, page: {curr: 1}});
        });

        function deleteApply(data) {
            website.get(ctx + 'declareTopic/delete?declareId=' + data, null, function () {
                website.alert.success('删除信息成功');
                $query.click();
            });
        }

        function initSolicitTable() {
            tableSolicitIns = website.table.init({
                elem: $solicitView.find('table'),
                id: 'classSolicitTable',
                url: ctx + 'biz/topicSelect/client/list',
                cols: [
                    [
                        {field: 'noticeName', title: '征集公告名称', minWidth: 100},
                        {field: 'topicName', title: '课题建议名称', minWidth: 150},
                        {field: 'userName', title: '建议人'},
                        {title: '职务', templet: '#position-type'},
                        {title: '职称', templet: '#title-type'},
                        {field: 'mobile', title: '手机'},
                        {field: 'phone', title: '座机'},
                        {title: '操作', toolbar: '#solicit-option', minWidth: 300}
                    ]
                ]
            });
        }


        table.on('tool(classSolicitTable)', function (obj) {
            let data = obj.data,
                layEvent = obj.event;
            if (layEvent === 'detail') {
                data.selectId
                // 查看详情
                website.navigate("/client/classSolicitDetail/" + data.selectId)
            }
            if (layEvent === 'del') {
                website.modal.confirm('删除课题', '确定删除该课题？', function () {
                    deleteSolicitInfos(data.selectId);
                });
            }
            if (layEvent === 'edit') {
                // 修改
                website.navigate("/client/updateClassSolicit/" + data.selectId)
            }
            if (layEvent === 'submit') {
                client.checkSubmit(function () {
                    website.post(ctx + 'topicSelect/submit/' + data.selectId, null, function () {
                        //  update
                        $querySolicit.click();
                        website.alert.success('提交信息成功');
                        layer.closeAll()
                    });
                });
            }

        });

        function getSolicitQueryParams() {
            let params = $solicitForm.serializeJson();
            return params;
        }

        $querySolicit.on('click', function () {
            let params = $.extend(getSolicitQueryParams(), {
                field: sortSolicitObject.field,
                order: sortSolicitObject.type
            });
            tableSolicitIns.reload({where: params, page: {curr: 1}});
        });


        function deleteSolicitInfos(data) {
            website.post(ctx + 'topicSelect/delete/' + data, null, function () {
                website.alert.success('删除信息成功');
                $querySolicit.click();
            });
        }

        // 课题申报新增按钮页面跳转
        $addApply.on('click', function () {
            website.navigate("/client/addClassApply")
        })
        // 选题征集新增按钮页面跳转
        $addSolicit.on('click', function () {
            website.navigate("/client/addClassSolicit")
        })

        $addEntrust.on('click', function () {
            website.navigate("/client/addClassEntrust")
        })

        /**
         * 初始化表格
         */
        function initEntrustTable() {
            tableEntrustIns = website.table.init({
                elem: $entrustView.find('table'),
                id: 'declareEntrustTable',
                url: ctx + 'declareEntrust/getList',
                cols: [
                    [
                        {type: 'numbers', title: '序号'},
                        {field: 'name', title: '课题名称', minWidth: 100},
                        {field: 'topicName', title: '选题名称', minWidth: 100},
                        {field: 'topicUnitName', title: '课题组织单位',},
                        {field: 'initiatorName', title: '牵头人姓名'},
                        {templet: '#examineType', title: '状态'},
                        {title: '操作', align: 'center', toolbar: '#declareEntrust-option', minWidth: 300}
                    ]
                ]
            });
        }


        /**
         * table操作栏的按钮监听事件
         **/
        table.on('tool(declareEntrustTable)', function (obj) {
            let data = obj.data,
                layEvent = obj.event;
            if (layEvent === 'detail') {
                website.navigate('/client/entrustClassDetail/' + data.declareId)
            }

            if (layEvent === 'edit') {
                website.navigate('/client/updateEntrustClass/' + data.declareId)
            }
            if (layEvent === 'delete') {
                website.post('/declareEntrust/delete/' + data.declareId, null, function () {
                    website.alert.success('删除成功');
                    $queryEntrust.click();
                })
            }
            if (layEvent === 'changeApply') {
                website.navigate('/client/updateEntrustClass/changeApply/' + data.declareId)
            }

            if (layEvent === 'postponeApply') {
                openPostponeApply(data.declareId)
            }
            if (layEvent === 'endApply') {
                preEndApply(data.declareId)
            }
            if (layEvent === 'submit') {
                client.checkSubmit(function () {
                    website.post('/infoApply/' + data.entrustId, null, function () {
                        website.alert.success('提交成功');
                        $queryEntrust.click();
                    })
                })
            }
            if (layEvent === 'appraisalResult') {
                // 查看评审结果
                website.navigate("/client/classAppraisalResult/" + data.declareId)
            }
            if (layEvent === 'appropriationRecords') {
                // 查看经费拨付记录

                website.modal.open('经费拨付记录', 'client/classAppropriationRecords/' + data.declareId, {
                    btn: ['返回'],
                    area: $(window).width() <= 750 ? '95%' : '50%',
                    offset: '30px',
                    yes: function (index, layero) {
                        layer.closeAll();
                    }
                });
            }

        });

        function getEntrustQueryParams() {
            let params = $entrustForm.serializeJson();
            return params;
        }

        $queryEntrust.on('click', function () {
            let params = $.extend(getEntrustQueryParams(), {field: sortObject.field, order: sortObject.type});
            tableEntrustIns.reload({where: params, page: {curr: 1}});
        });


        function initApplicantInfo() {
            if (applicantInfo) {
                $("#sexTypeCode").text(applicantInfo.sexTypeCode ? layui.dict.getByCode(applicantInfo.sexTypeCode).name : '');
                $("#positionTypeCode").text(applicantInfo.positionTypeCode ? layui.dict.getByCode(applicantInfo.positionTypeCode).name : '');
                $("#titleTypeCode").text(applicantInfo.titleTypeCode ? layui.dict.getByCode(applicantInfo.titleTypeCode).name : '');
                $("#nationTypeCode").text(applicantInfo.nationTypeCode ? layui.dict.getByCode(applicantInfo.nationTypeCode).name : '');
                $("#politicalTypeCode").text(applicantInfo.politicalTypeCode ? layui.dict.getByCode(applicantInfo.politicalTypeCode).name : '');
                $("#language").text(applicantInfo.language ? layui.dict.getByCode(applicantInfo.language).name : '');
                $("#degreeTypeCode").text(applicantInfo.degreeTypeCode ? layui.dict.getByCode(applicantInfo.degreeTypeCode).name : '');
                $("#tutorTypeCode").text(applicantInfo.tutorTypeCode ? layui.dict.getByCode(applicantInfo.tutorTypeCode).name : '');
            }
        }


        $updateApplicantInfo.on('click', function () {
            website.modal.open('修改信息', 'client/updateApplicant', {
                btn: ['提交', '取消'],
                area: [$(window).width() <= 750 ? '95%' : '50%', '70%'],
                offset: '30px',
                yes: function (index, layer) {
                    $('#website-user-applicant-update').find('#submit').click()
                },
                btn2: function () {
                    layer.closeAll()
                }
            });
        });


        $updateApplicantMobile.on('click', function () {
            client.updateEmail(ctx);
        });


        $updateApplicantPassword.on('click', function () {
                client.updatePassword(ctx)
            }
        );

        function preItemApply(declareId) {
            let href = 'applicantInfo/exportPreItemApply/' + declareId
            layer.open({
                type: 1
                , title: '拟立项提交申请' //不显示标题栏
                , shade: 0.3
                , area: $(window).width() <= 750 ? '80%' : '50%'
                , id: 'LAY_layui_pre_item_apply' //设定一个id，防止重复弹出
                , btn: ['提交', '关闭']
                , btnAlign: 'c'
                , zIndex: 3000
                , moveType: 1 //拖拽模式，0或者1
                , content: '<form class="layui-form layui-form-item">\n' +
                    '<a class="layui-input-block" href="' + href + '">点击下载拟立项申请书</a>' +
                    '    <div class="layui-row ">\n' +
                    '        <div class="layui-inline layui-col-xs5 layui-col-sm5 layui-col-md5">\n' +
                    '            <label class="layui-form-label website-form-item-require">拟立项申请书：</label>\n' +
                    '<a id="upload-file-a"></a>' +
                    '            <button type="button" class="layui-btn" id="upload-file">\n' +
                    '                <i class="layui-icon">&#xe67c;</i>上传拟立项申请书\n' +
                    '            </button>\n' +
                    '        </div>\n' +
                    '\n' +
                    '        <div class="layui-inline layui-col-xs5 layui-col-sm5 layui-col-md5 layui-col-md-offset1 layui-col-lg-offset1">\n' +
                    '            <label class="layui-form-label website-form-item-require">资格证明材料：</label>\n' +
                    '<a id="upload-file-anonymous-a"></a>' +
                    '            <button type="button" class="layui-btn" id="upload-file-anonymous">\n' +
                    '                <i class="layui-icon">&#xe67c;</i>上传资格证明材料\n' +
                    '            </button>\n' +
                    '        </div>\n' +
                    '    </div>\n' +
                    '</form>'
                , yes: function (index, layero) {
                    client.checkSubmit(function () {
                        let params = {
                            applyFileId: $('#upload-file')[0].getAttribute('file-id'),
                            preItemFileId: $('#upload-file-anonymous')[0].getAttribute('file-id')
                        }
                        if (!params.applyFileId || !params.preItemFileId) {
                            website.alert.error('请上传文件');
                            return false;
                        }
                        // 申请详情
                        website.post(ctx + 'biz/preItem/apply/' + declareId, params, function (data) {
                            website.alert.success('申请提交成功');
                            $query.click();
                            layer.closeAll();
                        });
                    })

                },
                success: function () {

                    uploadFile = upload.render({
                        elem: '#upload-file' //绑定元素
                        , url: '/upload' //上传接口
                        , done: function (res) {
                            //上传完毕回调
                            if (res.code === 200) {
                                website.alert.success('上传文件成功');
                                let data = res.data
                                $('#upload-file')[0].setAttribute('file-id', data.fileId)
                                $('#upload-file-a')[0].setAttribute('href', ctx + 'download/' + data.fileId)
                                $("#upload-file-a").text(data.name)
                            }
                        }
                        , error: function () {
                            //请求异常回调
                            website.alert.error('上传文件失败');
                        },
                        accept: 'file',
                        size: 1024 * 50
                    });

                    uploadFileAnonymous = upload.render({
                        elem: '#upload-file-anonymous' //绑定元素
                        , url: '/upload' //上传接口
                        , done: function (res) {
                            //上传完毕回调
                            if (res.code === 200) {
                                website.alert.success('上传文件成功');
                                let data = res.data
                                $('#upload-file-anonymous')[0].setAttribute('file-id', data.fileId)
                                $("#upload-file-anonymous-a")[0].setAttribute('href', ctx + 'download/' + data.fileId)
                                $("#upload-file-anonymous-a").text(data.name)
                            }
                        }
                        , error: function () {
                            //请求异常回调
                            website.alert.error('上传文件失败');
                        },
                        accept: 'file',
                        size: 1024 * 50
                    });
                }
            });
        };

        // 委托课题
        function preEndApply(declareId) {
            let href = ctx + 'exportEntrustConclusionApply/' + declareId
            layer.open({
                type: 1
                , title: '结项提交申请' //不显示标题栏
                , shade: 0.3
                , area: [$(window).width() <= 750 ? '95%' : '50%', '70%']
                , id: 'LAY_layui_end_apply' //设定一个id，防止重复弹出
                , btn: ['提交', '关闭']
                , btnAlign: 'c'
                , zIndex: 3000
                , moveType: 1 //拖拽模式，0或者1
                , content: '<form class="layui-form " id="end-apply-form">\n' +
                    ' <a href="' + href + '">点击下载结项申请书</a>' +
                    '    <div class="layui-row">\n' +
                    '        <div class="layui-form-item layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-md-offset1 layui-col-lg-offset1">\n' +
                    '            <label class="layui-form-label website-form-item-require">结项申请书：</label>\n' +
                    '<a id="upload-file-end-apply-a"></a>' +
                    '            <button type="button" class="layui-btn" id="upload-file-end-apply">\n' +
                    '                <i class="layui-icon">&#xe67c;</i>上传拟立项申请书\n' +
                    '            </button>\n' +
                    '      </div>   </div>\n' +
                    '\n <div class="layui-row">' +
                    '        <div class="layui-form-item layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-md-offset1 layui-col-lg-offset1">\n' +
                    '            <label class="layui-form-label website-form-item-require">显名附件：</label>\n' +
                    '<a id="upload-file-end-a"></a>' +
                    '            <button type="button" class="layui-btn" id="upload-file-end">\n' +
                    '                <i class="layui-icon">&#xe67c;</i>上传材料\n' +
                    '            </button>\n' +
                    '      </div>  </div> \n' +
                    '<div class="layui-row">' +
                    '        <div class="layui-form-item  layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-md-offset1 layui-col-lg-offset1">\n' +
                    '            <label class="layui-form-label website-form-item-require">匿名附件：</label>\n' +
                    '<a id="upload-file-end-anonymous-a"></a>' +
                    '            <button type="button" class="layui-btn" id="upload-file-end-anonymous">\n' +
                    '                <i class="layui-icon">&#xe67c;</i>上传材料\n' +
                    '            </button>\n' +
                    '   </div>     \n' +
                    '  </div> \n' +
                    '<div class="layui-row" >\n' +
                    '        <div class="layui-form-item layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-md-offset1 layui-col-lg-offset1">\n' +
                    '            <label class="layui-form-label website-form-item-require">成果形式：</label>\n' +
                    '            <div class="layui-input-block">\n' +
                    ' <select name="achievementFormTypeCode"\n' +
                    '                                            lay-verify="required"\n' +
                    '                                            xm-select-direction="down"\n' +
                    '                                            xm-select="achievementFormTypeCode"\n' +
                    '                                            xm-select-skin="default">\n' +
                    '                                        <option value="">请选择</option>' +
                    appendAchievementFormHtml() + '</select>' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '</div>' +
                    '<div class="layui-row">' +
                    '<div class="layui-form-item layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-md-offset1 layui-col-lg-offset1">\n' +
                    '                                <label class="layui-form-label website-form-item-require">成果字数</label>\n' +
                    '                                <div class="layui-input-inline">\n' +
                    '                                    <input type="number" name="number" autocomplete="off"\n' +
                    '                                           lay-verify="required" maxlength="50"\n' +
                    '                                           class="layui-input" >\n' +
                    '                                </div>\n' +
                    '                                <div class="layui-form-mid layui-word-aux">万字</div>\n' +
                    '                            </div>' +
                    '                            </div>' +
                    '</form>'
                , yes: function (index, layero) {
                    client.checkSubmit(function () {
                        let params = $('#end-apply-form').serializeJson()
                        params.declareId = declareId
                        params.fileApplyId = $('#upload-file-end-apply')[0].getAttribute('file-id')
                        params.fileShowId = $('#upload-file-end')[0].getAttribute('file-id')
                        params.fileHideId = $('#upload-file-end-anonymous')[0].getAttribute('file-id')
                        if (!params.fileApplyId || !params.fileShowId || !params.fileHideId) {
                            website.alert.error('附件未上传，请上传附件！');
                            return false;
                        }
                        if (!params.number || !params.achievementFormTypeCode) {
                            website.alert.error('请填写必填项！');
                            return false;
                        }

                        // 申请详情
                        website.post(ctx + 'biz/declareEntrust/conclusion', params, function (data) {
                            website.alert.success('申请提交成功');
                            $queryEntrust.click();
                            layer.closeAll();
                        });
                    })
                },
                success: function () {
                    formSelects.render();
                    uploadFileEndApply = upload.render({
                        elem: '#upload-file-end-apply' //绑定元素
                        , url: '/upload' //上传接口
                        , done: function (res) {
                            if (res.code === 200) {
                                website.alert.success('上传文件成功');
                                let data = res.data
                                $('#upload-file-end-apply')[0].setAttribute('file-id', data.fileId)
                                //上传完毕回调
                                $('#upload-file-end-apply-a')[0].setAttribute('href', ctx + 'download/' + data.fileId)
                                $("#upload-file-end-apply-a").text(data.name)
                            }
                        }
                        , error: function () {
                            //请求异常回调
                            website.alert.error('上传文件失败');
                        },
                        accept: 'file',
                        size: 1024 * 50
                    });
                    uploadFileEnd = upload.render({
                        elem: '#upload-file-end' //绑定元素
                        , url: '/upload' //上传接口
                        , done: function (res) {
                            if (res.code === 200) {
                                website.alert.success('上传文件成功');
                                let data = res.data
                                $('#upload-file-end')[0].setAttribute('file-id', data.fileId)
                                $('#upload-file-end-a')[0].setAttribute('href', ctx + 'download/' + data.fileId)
                                $("#upload-file-end-a").text(data.name)
                                //上传完毕回调
                            }
                        }
                        , error: function () {
                            //请求异常回调
                            website.alert.error('上传文件失败');
                        },
                        accept: 'file',
                        size: 1024 * 50
                    });
                    uploadFileAnonymousEnd = upload.render({
                        elem: '#upload-file-end-anonymous' //绑定元素
                        , url: '/upload' //上传接口
                        , done: function (res) {
                            if (res.code === 200) {
                                website.alert.success('上传文件成功');
                                let data = res.data
                                $('#upload-file-end-anonymous')[0].setAttribute('file-id', data.fileId)
                                $('#upload-file-end-anonymous-a')[0].setAttribute('href', ctx + 'download/' + data.fileId)
                                $("#upload-file-end-anonymous-a").text(data.name)
                                //上传完毕回调
                            }
                        }
                        , error: function () {
                            //请求异常回调
                            website.alert.error('上传文件失败');
                        },
                        accept: 'file',
                        size: 1024 * 50
                    });

                }
            });
        };


        function appendAchievementFormHtml() {
            let html = ''
            $.each(achievementForm, function (i, item) {
                html += '<option value="' + item.code + '">' + item.name + '</option>'
            })
            return html
        }


        function classApplyOpen(declareId) {
            website.modal.open('申请人承诺书', 'client/classApplyCommitment', {
                btn: ['同意', '取消'],
                area: $(window).width() <= 750 ? '95%' : '50%',
                offset: '30px',
                yes: function (index, layero) {
                    // 申请详情
                    website.post(ctx + 'declareTopic/' + declareId + '/commit', null, function (data) {
                        website.alert.success('课题申请提交成功');
                        $query.click();
                        layer.closeAll();
                    });
                },
                btn2: function () {
                    layer.closeAll()
                }
            });
        }

        function openPostponeApply(id) {
            let href = ctx + 'exportDelayApply/' + id;
            layer.open({
                type: 1
                , title: '延期申请' //不显示标题栏
                , shade: 0.4
                , area: [$(window).width() <= 750 ? '95%' : '50%', '60%']
                , id: 'LAY_layuinoreal_postpone' //设定一个id，防止重复弹出
                , btn: ['提交', '关闭']
                , btnAlign: 'c'
                , zIndex: 3000
                , moveType: 1 //拖拽模式，0或者1
                , content:
                    '  <form id="postponeForm" class="layui-form">\n' +
                    ' <a class="layui-input-block" href="' + href + '">点击下载延期申请书</a>' +
                    '<div class="layui-row" >\n' +
                    '        <div class="layui-form-item layui-col-xs8 layui-col-sm8 layui-col-md8 ">\n' +
                    ' <label class="layui-form-label website-form-item-require">延期时长</label>\n' +
                    '<div class="layui-input-inline">\n' +
                    '                                    <input type="number" name="duration" autocomplete="off"\n' +
                    '                                      lay-verify="required"   class="layui-input">\n' +
                    '                                </div>\n' +
                    '                                <div class="layui-form-mid layui-word-aux">月</div>' +
                    '        </div>\n' +
                    '</div>' +
                    '<div class="layui-row layui-form-item">\n' +
                    '        <div class="layui-form-item layui-col-xs8 layui-col-sm8 layui-col-md8 ">\n' +
                    ' <label class=" layui-form-label website-form-item-require">延期期限</label>\n' +
                    '                                <div class="layui-input-block">\n' +
                    '                                    <input type="text" id="deadlineTime"\n' +
                    '                 lay-verify="required"     name="term" autocomplete="off"\n' +
                    '                                           class="layui-input">\n' +
                    '                                </div>' +
                    '        </div>\n' +
                    '</div>' +
                    '<div class="layui-row layui-form-item">\n' +
                    '        <div class="layui-form-item layui-col-xs8 layui-col-sm8 layui-col-md8 ">\n' +
                    '            <label class="layui-form-label website-form-item-require">延期原因：</label>\n' +
                    '<div class="layui-input-block">\n' +
                    '                                    <input type="text" name="reason" autocomplete="off"\n' +
                    '                 lay-verify="required"     class="layui-input">\n' +
                    '                                </div>\n' +
                    '        </div>\n' +
                    '</div>' +
                    '    <div class="layui-row layui-form-item">\n' +
                    '        <div class="layui-inline layui-col-xs5 layui-col-sm5 layui-col-md5">\n' +
                    '            <label class="layui-form-label">附件：</label>\n' +
                    '<a id="postpone-apply-upload-file-a"></a>' +
                    '            <button type="button" class="layui-btn" id="postpone-apply-upload-file">\n' +
                    '                <i class="layui-icon">&#xe67c;</i>上传附件\n' +
                    '            </button>\n' +
                    '        </div>\n' +
                    '<div class="website-hide">\n' +
                    '                    <button class="layui-btn" id="submit" lay-submit="" lay-filter="home-postpone-form-submit">保存\n' +
                    '                    </button>\n' +
                    '                </div>' +
                    '    </form>\n'

                , yes: function (index, layero) {

                    /*
                   TODO 先做为非必填项，后期可能更改
                   if (!formData.delayFileId) {
                         website.alert.error('请上传附件！');
                         return false;
                     }*/
                    client.checkSubmit(function () {
                        $('#postponeForm').find('#submit').click();
                    })
                },
                success: function () {
                    postponeApplyUploadFile = upload.render({
                        elem: '#postpone-apply-upload-file' //绑定元素
                        , url: '/upload' //上传接口
                        , done: function (res) {
                            if (res.code === 200) {
                                website.alert.success('上传文件成功');
                                let data = res.data
                                $('#postpone-apply-upload-file')[0].setAttribute('file-id', data.fileId)
                                //上传完毕回调
                                $('#postpone-apply-upload-file-a')[0].setAttribute('href', ctx + 'download/' + data.fileId)
                                $("#postpone-apply-upload-file-a").text(data.name)
                            }
                        }
                        , error: function () {
                            //请求异常回调
                            website.alert.error('上传文件失败');
                        },
                        accept: 'file',
                        size: 1024 * 50
                    });

                    form.on('submit(home-postpone-form-submit)', function () {
                        let formData = $('#postponeForm').serializeJson();
                        // delayEntrustApply
                        formData.delayFileId = $('#postpone-apply-upload-file')[0].getAttribute('file-id')
                        formData.declareId = id
                        website.post(ctx + 'delayEntrustApply', formData, function (data) {
                            website.alert.success('提交成功');
                            $queryEntrust.click();
                            layer.closeAll();
                        });
                        return false;
                    });

                    laydate.render({
                        elem: '#deadlineTime', //指定元素
                        trigger: 'click',
                    });
                }
            });
        }


    })
</script>
